import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';

const path = require('path');
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
export default defineConfig({
  base: './',
  plugins: [
    vue(),
    Components({
      resolvers: [
        ElementPlusResolver({
          importStyle: 'sass'
        })
      ]
    })
  ],
  optimizeDeps: {
    include: ['@surely-vue/table', 'vue']
  },
  resolve: {
    alias: {
      protobufjs: 'protobufjs/dist/protobuf.min.js',
      '@': path.resolve(__dirname, '.', './src/')
    }
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@use "@/styles/element/index.scss" as *;`
      }
    }
  }
  // build: {
  //   sourcemap: true
  // }
});
